import React, { useState, useMemo } from 'react'

const App = () => {
	const [count, setCount] = useState(0)

	const result = useMemo(() => {
		// 如果 count 值发生变化此函数重新执行，并且可以在视图上渲染
		return count * 2
	}, [count])

	return (
		<div>
			{count} {result}
		</div>
	)
}

export default App
